package com.dao;

import com.bean.Room;
import com.util.C3p0Utils;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.apache.commons.dbutils.handlers.ScalarHandler;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public interface RoomDAO {

    /**
     * BeanListHandler将结果列表封装
     * @return
     * @throws SQLException
     */
     List<Room> selectAll() throws SQLException ;

    /**
     * BeanHandler将单个列表封装
     * @param id
     * @return
     * @throws SQLException
     */
     Room selectById(Integer id) throws SQLException ;


     boolean deleteById(Integer id) throws SQLException ;

     boolean deleteAll(String[] idsArr) throws SQLException ;

     boolean insert(Room r) throws SQLException ;

     boolean update(Room r) throws SQLException ;


    /**
     * ScalarHandler用来将单个Object类型封装
     * @return
     * @throws SQLException
     */
     Integer count() throws SQLException ;

     Integer countSearch(String search) throws SQLException ;

    Integer countSearch(Map<String,String> map) throws SQLException ;

     List<Room> selectAllPagination(Integer offset, Integer limit) throws SQLException ;

     List<Room> selectAllPaginationSearch(Integer offset, Integer limit, String search) throws SQLException ;

    List<Room> selectAllPaginationSearch(Integer offset, Integer limit, Map map) throws SQLException ;
}
